package com.dingwen.treasure.security.config;

import cn.hutool.core.collection.CollUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * 　SecurityProperties： spring security 安全配置
 * 　@author dingwen
 * 　@date 2022/6/13
 *
 */
@Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "treasure.security")
@Getter
@Setter
public class SecurityProperties {


    /**
     * 允许匿名访问的url (即登录之后不能访问)
     */
    private final List<String> anonymous = CollUtil.newArrayList();

    /**
     * 忽略的 URL，不需要认证允许匿名访问的
     */
    private final List<String> ignores = CollUtil.newArrayList();

    /**
     * 忽略的get请求URL
     */
    private final List<String> get = CollUtil.newArrayList();

    /**
     * 忽略的pst请求URL
     */
    private final List<String> post = CollUtil.newArrayList();

    /**
     * 忽略的put请求URL
     */
    private final List<String> put = CollUtil.newArrayList();

    /**
     * 忽略的delete请求URL
     */
    private final List<String> delete = CollUtil.newArrayList();

    /**
     * 忽略的head请求URL
     */
    private final List<String> head = CollUtil.newArrayList();

    /**
     * 忽略的options请求URL
     */
    private final List<String> options = CollUtil.newArrayList();

    /**
     * 忽略的trace请求URL
     */
    private final List<String> trace = CollUtil.newArrayList();
}
